package cn.tedu.spring.example;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 测试类
 */
public class TestUser {
    public static void main(String[] args) {
        ApplicationContext context =new AnnotationConfigApplicationContext
                ("cn.tedu.spring.example");
        //context.getBean(User.class) var+回车
        User user = context.getBean(User.class);
        user.run();

//        ApplicationContext context = new ClassPathXmlApplicationContext
//                ("bean.xml");
//        User user = context.getBean(User.class);
//        user.run();
    }
}
